Skip to content

Optimize conflict-heavy EVM transfer execution#3405

Merged
codchen merged 2 commits into
mainfrom
tony/evm-transfer-optimizations
May 19, 2026
Merged

Optimize conflict-heavy EVM transfer execution#3405
codchen merged 2 commits into
mainfrom
tony/evm-transfer-optimizations

Conversation

@codchen
Copy link
Copy Markdown
Collaborator

@codchen codchen commented May 7, 2026

Summary

  • Reuses the preprocessed derived sender during EVM DeliverTx association to avoid repeating signature recovery work.
  • Reuses an empty cast auth account for EVM association when it is safe, preserving account number/sequence and avoiding extra account-number churn.
  • Skips direct-cast self migration when the cast address and derived Sei address are the same.
  • Detects large simple EVM transfer blocks that all target the same recipient and routes them through sequential execution instead of OCC retry churn. This applies to both the regular V2 path and the Giga path.

This is split out from #3376 so the behavior changes can be reviewed separately from logging and stress tooling.

Test Plan

  • go test ./app ./utils/helpers ./app/ante ./x/evm/ante ./x/evm/types

Note

Medium Risk
Changes EVM DeliverTx signature/association flow, account mapping/migration behavior, and block execution routing between OCC and sequential paths; mistakes here could affect transaction validity, nonce/account state, or block processing performance.

Overview
Improves EVM tx processing in conflict-heavy scenarios by reusing already-computed msg.Derived sender data during DeliverTx, avoiding repeated signature recovery and adding explicit invalid-pubkey rejection.

Adjusts address association to reuse an existing empty “cast” auth account (preserving account number/sequence) when safe, and skips balance migration when the cast address and Sei address are identical.

Adds a heuristic to detect large blocks (>=64) of simple EVM value transfers to a single recipient and forces sequential execution for those blocks (including disabling Giga OCC in that case) to avoid OCC retry churn.

Reviewed by Cursor Bugbot for commit 0203fa4. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 18, 2026, 3:12 AM

@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

❌ Patch coverage is 62.22222% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.29%. Comparing base (823a78d) to head (ef8c47c).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
app/app.go 50.00% 9 Missing and 2 partials ⚠️
app/ante/evm_delivertx.go 45.45% 3 Missing and 3 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3405   +/-   ##
=======================================
  Coverage   59.29%   59.29%           
=======================================
  Files        2125     2125           
  Lines      175629   175672   +43     
=======================================
+ Hits       104144   104170   +26     
- Misses      62404    62416   +12     
- Partials     9081     9086    +5     
Flag Coverage Δ
sei-chain-pr 49.72% <62.22%> (?)
sei-db 70.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
utils/helpers/associate.go 75.67% <100.00%> (+10.29%) ⬆️
app/ante/evm_delivertx.go 67.74% <45.45%> (-4.81%) ⬇️
app/app.go 69.15% <50.00%> (-0.28%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codchen codchen force-pushed the tony/evm-transfer-optimizations branch from 0203fa4 to ef8c47c Compare May 18, 2026 03:11
@cursor
Copy link
Copy Markdown

cursor Bot commented May 18, 2026

PR Summary

Medium Risk
Changes EVM ante/address-association and block execution routing, which can affect nonce/account state and when blocks run sequentially vs OCC; mistakes could cause consensus or performance regressions under heavy transfer loads.

Overview
Improves EVM tx delivery performance by reusing preprocessed derived sender info in EvmDeliverHandleSignatures, skipping redundant signature recovery and validating derived pubkeys.

Adds a heuristic to detect large blocks (>=64) of simple value-only EVM transfers to a single recipient and forces sequential execution (including bypassing Giga OCC) to avoid OCC retry churn.

Optimizes EVM↔Sei association by reusing an existing empty “cast” BaseAccount (preserving account number/sequence) when safe, creating the Sei account if missing, and skipping balance migration when the cast and Sei addresses are identical; expands unit tests to cover these cases.

Reviewed by Cursor Bugbot for commit ef8c47c. Bugbot is set up for automated code reviews on this repo. Configure here.

@codchen codchen added this pull request to the merge queue May 19, 2026
Merged via the queue into main with commit 5ac709d May 19, 2026
41 checks passed
@codchen codchen deleted the tony/evm-transfer-optimizations branch May 19, 2026 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants